#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include "led_desc.h"

MODULE_LICENSE("GPL");

static led_desc_t leds[] = 
{
    {74,"led1"},
	{90,"led2"},
	{72,"led3"},
};

void dev_release(struct device *dev)// 避免警告
{
    printk("enter %s\n", __func__);
}

struct platform_device led_dev = 
{
    .name = "myLedsDevice",
    .dev = 
    {
        .platform_data = leds, //接口信息
        .release = dev_release //避免警告
    },
    // .resource =   //接口信息  中断号   物理地址....
};


static int __init led_dev_init(void)
{
    platform_device_register(&led_dev);
    return 0;
}

static void __exit led_dev_exit(void)
{
    platform_device_unregister(&led_dev);
}

module_init(led_dev_init);
module_exit(led_dev_exit);